/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

//w 1051 jest odwołanie do tabla do zmiany. nie  wiem skąd konkretnie pobierasz smallBlinda, więc po prostu potrzeba tam referencji
//potrzbna też referencja do NumberofPalyers
package ala;

/**
 *
 * @author Asia
 */

import static ala.BadugiGUI.Accept;
import static ala.BadugiGUI.Account;
import static ala.BadugiGUI.AccountState;
import static ala.BadugiGUI.AllIn;
import static ala.BadugiGUI.Check;
import static ala.BadugiGUI.ExchangeCards;
import static ala.BadugiGUI.Nr;
import static ala.BadugiGUI.OnTable;
import static ala.BadugiGUI.Out;
import static ala.BadugiGUI.Round;
import static ala.BadugiGUI.Send;
import static ala.BadugiGUI.Sum;
import static ala.BadugiGUI.TableCash;
import static ala.BadugiGUI.jButton10;
import static ala.BadugiGUI.jButton11;
import static ala.BadugiGUI.jButton12;
import static ala.BadugiGUI.jButton13;
import static ala.BadugiGUI.jButton14;
import static ala.BadugiGUI.jButton15;
import static ala.BadugiGUI.jButton16;
import static ala.BadugiGUI.jButton17;
import static ala.BadugiGUI.jButton18;
import static ala.BadugiGUI.jButton19;
import static ala.BadugiGUI.jButton20;
import static ala.BadugiGUI.jButton21;
import static ala.BadugiGUI.jButton22;
import static ala.BadugiGUI.jButton23;
import static ala.BadugiGUI.jButton24;
import static ala.BadugiGUI.jButton25;
import static ala.BadugiGUI.jButton26;
import static ala.BadugiGUI.jButton27;
import static ala.BadugiGUI.jButton28;
import static ala.BadugiGUI.jButton29;
import static ala.BadugiGUI.jButton6;
import static ala.BadugiGUI.jButton7;
import static ala.BadugiGUI.jButton8;
import static ala.BadugiGUI.jButton9;
import static ala.BadugiGUI.jCheckBox1;
import static ala.BadugiGUI.jCheckBox10;
import static ala.BadugiGUI.jCheckBox11;
import static ala.BadugiGUI.jCheckBox12;
import static ala.BadugiGUI.jCheckBox13;
import static ala.BadugiGUI.jCheckBox14;
import static ala.BadugiGUI.jCheckBox15;
import static ala.BadugiGUI.jCheckBox16;
import static ala.BadugiGUI.jCheckBox17;
import static ala.BadugiGUI.jCheckBox18;
import static ala.BadugiGUI.jCheckBox19;
import static ala.BadugiGUI.jCheckBox2;
import static ala.BadugiGUI.jCheckBox20;
import static ala.BadugiGUI.jCheckBox21;
import static ala.BadugiGUI.jCheckBox22;
import static ala.BadugiGUI.jCheckBox23;
import static ala.BadugiGUI.jCheckBox24;
import static ala.BadugiGUI.jCheckBox3;
import static ala.BadugiGUI.jCheckBox4;
import static ala.BadugiGUI.jCheckBox5;
import static ala.BadugiGUI.jCheckBox6;
import static ala.BadugiGUI.jCheckBox7;
import static ala.BadugiGUI.jCheckBox8;
import static ala.BadugiGUI.jCheckBox9;
import static ala.BadugiGUI.jPanel1;
import static ala.BadugiGUI.jPanel2;
import static ala.BadugiGUI.jPanel3;
import static ala.BadugiGUI.jPanel4;
import static ala.BadugiGUI.jScrollPane2;
import static ala.BadugiGUI.jScrollPane3;
import static ala.BadugiGUI.jTextArea1;
import static ala.BadugiGUI.jTextArea2;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.*;

import javax.swing.*;


/**
 *
 * @author Asia
 */
public class GUIoff extends javax.swing.JFrame{
    
    
    //GameIsOn metoda do liczenia rund które już przeszły, boole, jak więcej niż 3 to koniec i false
    
    
    JButton Accept,Out,AllIn,ExchangeCards,Send;
    
    JButton jButton6, jButton7,jButton8,jButton9;
    JButton jButton10,jButton11,jButton12,jButton13;
    JButton jButton14,jButton15,jButton16,jButton17;
    JButton jButton18,jButton19,jButton20,jButton21;
    JButton jButton22,jButton23,jButton24,jButton25;
    JButton jButton26, jButton27,jButton28,jButton29;
    JButton Check;
    
    JLabel Round, Nr, AccountState, Account, TableCash, OnTable, Communicate;
    
    JPanel jPanel1, jPanel2, jPanel3, jPanel4;
    
    JScrollPane jScrollPane1, jScrollPane2, jScrollPane3;
    
    JTextField Sum;
    
    JTextArea jTextArea1, jTextArea2;
    
    JFrame window;
    
    JCheckBox jCheckBox1,jCheckBox2,jCheckBox3,jCheckBox4;
    JCheckBox jCheckBox5,jCheckBox6,jCheckBox7,jCheckBox8;
    JCheckBox jCheckBox9, jCheckBox10,jCheckBox11,jCheckBox12;
    JCheckBox jCheckBox13,jCheckBox14,jCheckBox15,jCheckBox16;
    JCheckBox jCheckBox17,jCheckBox18,jCheckBox19,jCheckBox20;
    JCheckBox jCheckBox21,jCheckBox22,jCheckBox23,jCheckBox24;
    
    int money=0, bank=0, adventurer=0;
    int roundCounter=0, check=0;
    int NumberOfPlayers; //ściągnąć dane z klienta
    /*
     do klienta taka funkcja
     public int GetNumberOfPlayers(){
     nr=Integer.parseInt(Number.getText());
     return nr;
     */
    int bet=0;
    
    int[][] tablica;
    
    JLabel[] labelek;
    
    String player="";
    
    String buttonCard="";
    
    public GUIoff()
    {
        
        initComponents();
        
    }
    
    private void initComponents(){
        
        Check = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        Round = new javax.swing.JLabel();
        Nr = new javax.swing.JLabel();
        Accept = new javax.swing.JButton();
        AllIn = new javax.swing.JButton();
        ExchangeCards = new javax.swing.JButton();
        Sum = new javax.swing.JTextField();
        Out = new javax.swing.JButton();
        AccountState = new javax.swing.JLabel();
        Account = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        TableCash = new javax.swing.JLabel();
        OnTable = new javax.swing.JLabel();
        Communicate = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jScrollPane2 = new javax.swing.JScrollPane();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTextArea1 = new javax.swing.JTextArea();
        jTextArea2 = new javax.swing.JTextArea();
        Send = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        jButton6.setVisible(false);
        jButton6.setEnabled(false);
        jButton7 = new javax.swing.JButton();
        jButton7.setVisible(false);
        jButton7.setEnabled(false);
        jButton8 = new javax.swing.JButton();
        jButton8.setVisible(false);
        jButton8.setEnabled(false);
        jButton9 = new javax.swing.JButton();
        jButton9.setVisible(false);
        jButton9.setEnabled(false);
        jCheckBox1 = new javax.swing.JCheckBox();
        jCheckBox1.setVisible(false);
        jCheckBox1.setEnabled(false);
        jCheckBox2 = new javax.swing.JCheckBox();
        jCheckBox2.setVisible(false);
        jCheckBox2.setEnabled(false);
        jCheckBox3 = new javax.swing.JCheckBox();
        jCheckBox3.setVisible(false);
        jCheckBox3.setEnabled(false);
        jCheckBox4 = new javax.swing.JCheckBox();
        jCheckBox4.setVisible(false);
        jCheckBox4.setEnabled(false);
        jButton10 = new javax.swing.JButton();
        jButton10.setVisible(false);
        jButton10.setEnabled(false);
        jButton11 = new javax.swing.JButton();
        jButton11.setVisible(false);
        jButton11.setEnabled(false);
        jButton12 = new javax.swing.JButton();
        jButton12.setVisible(false);
        jButton12.setEnabled(false);
        jButton13 = new javax.swing.JButton();
        jButton13.setVisible(false);
        jButton13.setEnabled(false);
        jCheckBox5 = new javax.swing.JCheckBox();
        jCheckBox5.setVisible(false);
        jCheckBox5.setEnabled(false);
        jCheckBox6 = new javax.swing.JCheckBox();
        jCheckBox6.setVisible(false);
        jCheckBox6.setEnabled(false);
        jCheckBox7 = new javax.swing.JCheckBox();
        jCheckBox7.setVisible(false);
        jCheckBox7.setEnabled(false);
        jButton14 = new javax.swing.JButton();
        jButton14.setVisible(false);
        jButton14.setEnabled(false);
        jButton15 = new javax.swing.JButton();
        jButton15.setVisible(false);
        jButton15.setEnabled(false);
        jButton16 = new javax.swing.JButton();
        jButton16.setVisible(false);
        jButton16.setEnabled(false);
        jButton17 = new javax.swing.JButton();
        jButton17.setVisible(false);
        jButton17.setEnabled(false);
        jButton18 = new javax.swing.JButton();
        jButton18.setVisible(false);
        jButton18.setEnabled(false);
        jButton19 = new javax.swing.JButton();
        jButton19.setVisible(false);
        jButton19.setEnabled(false);
        jButton20 = new javax.swing.JButton();
        jButton20.setVisible(false);
        jButton20.setEnabled(false);
        jButton21 = new javax.swing.JButton();
        jButton21.setVisible(false);
        jButton21.setEnabled(false);
        jButton22 = new javax.swing.JButton();
        jButton22.setVisible(false);
        jButton22.setEnabled(false);
        jButton23 = new javax.swing.JButton();
        jButton23.setVisible(false);
        jButton23.setEnabled(false);
        jButton24 = new javax.swing.JButton();
        jButton24.setVisible(false);
        jButton24.setEnabled(false);
        jButton25 = new javax.swing.JButton();
        jButton25.setVisible(false);
        jButton25.setEnabled(false);
        jButton26 = new javax.swing.JButton();
        jButton26.setVisible(false);
        jButton26.setEnabled(false);
        jButton27 = new javax.swing.JButton();
        jButton27.setVisible(false);
        jButton27.setEnabled(false);
        jButton28 = new javax.swing.JButton();
        jButton28.setVisible(false);
        jButton28.setEnabled(false);
        jButton29 = new javax.swing.JButton();
        jButton29.setVisible(false);
        jButton29.setEnabled(false);
        jCheckBox8 = new javax.swing.JCheckBox();
        jCheckBox8.setVisible(false);
        jCheckBox8.setEnabled(false);
        jCheckBox9 = new javax.swing.JCheckBox();
        jCheckBox9.setVisible(false);
        jCheckBox9.setEnabled(false);
        jCheckBox10 = new javax.swing.JCheckBox();
        jCheckBox10.setVisible(false);
        jCheckBox10.setEnabled(false);
        jCheckBox11 = new javax.swing.JCheckBox();
        jCheckBox11.setVisible(false);
        jCheckBox11.setEnabled(false);
        jCheckBox12 = new javax.swing.JCheckBox();
        jCheckBox12.setVisible(false);
        jCheckBox12.setEnabled(false);
        jCheckBox13 = new javax.swing.JCheckBox();
        jCheckBox13.setVisible(false);
        jCheckBox13.setEnabled(false);
        jCheckBox14 = new javax.swing.JCheckBox();
        jCheckBox14.setVisible(false);
        jCheckBox14.setEnabled(false);
        jCheckBox15 = new javax.swing.JCheckBox();
        jCheckBox15.setVisible(false);
        jCheckBox15.setEnabled(false);
        jCheckBox16 = new javax.swing.JCheckBox();
        jCheckBox16.setVisible(false);
        jCheckBox16.setEnabled(false);
        jCheckBox17 = new javax.swing.JCheckBox();
        jCheckBox17.setVisible(false);
        jCheckBox17.setEnabled(false);
        jCheckBox18 = new javax.swing.JCheckBox();
        jCheckBox18.setVisible(false);
        jCheckBox18.setEnabled(false);
        jCheckBox19 = new javax.swing.JCheckBox();
        jCheckBox19.setVisible(false);
        jCheckBox19.setEnabled(false);
        jCheckBox20 = new javax.swing.JCheckBox();
        jCheckBox20.setVisible(false);
        jCheckBox20.setEnabled(false);
        jCheckBox21 = new javax.swing.JCheckBox();
        jCheckBox21.setVisible(false);
        jCheckBox21.setEnabled(false);
        jCheckBox22 = new javax.swing.JCheckBox();
        jCheckBox22.setVisible(false);
        jCheckBox22.setEnabled(false);
        jCheckBox23 = new javax.swing.JCheckBox();
        jCheckBox23.setVisible(false);
        jCheckBox23.setEnabled(false);
        jCheckBox24 = new javax.swing.JCheckBox();
        jCheckBox24.setVisible(false);
        jCheckBox24.setEnabled(false);
        
        setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
        //na jakiej zasadzie dajemy możliwość zamknięcia okna z grą?
        //no bo nie możemy go tak zablokować że zablokować do momentu gdy Round==3 albo zrobi Outa
        //to co, ma wyskakiwać okienko z komunikatem że jak przerwie grę to straci całą kasę, albo że zamykając okno zachowuje sie tak jakby wcisnął out?
        
        setBackground(new java.awt.Color(51, 102, 0));
        
        
        jPanel1.setBackground(new java.awt.Color(0, 153, 153));
        
        
        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
                                         jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                         .addGap(0, 216, Short.MAX_VALUE)
                                         );
        jPanel2Layout.setVerticalGroup(
                                       jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                       .addGap(0, 366, Short.MAX_VALUE)
                                       );
        
        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
                                         jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                         .addGroup(jPanel1Layout.createSequentialGroup()
                                                   .addContainerGap()
                                                   .addComponent(Round)
                                                   .addGap(18, 18, 18)
                                                   .addComponent(Nr, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                   .addGap(33, 33, 33)
                                                   .addComponent(AccountState)
                                                   .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                   .addComponent(Account, javax.swing.GroupLayout.DEFAULT_SIZE, 313, Short.MAX_VALUE)
                                                   .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                   .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                             .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                             .addGroup(jPanel1Layout.createSequentialGroup()
                                                                       .addComponent(Check, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                       .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                       .addComponent(ExchangeCards, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                       .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                       .addComponent(AllIn, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                       .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                       .addComponent(Out, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                       .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                       .addComponent(Sum, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                       .addGap(18, 18, 18)
                                                                       .addComponent(Accept, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                       .addContainerGap())))
                                         );
        jPanel1Layout.setVerticalGroup(
                                       jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                       .addGroup(jPanel1Layout.createSequentialGroup()
                                                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                           .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                                                     .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                                     .addComponent(Accept, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                           .addGroup(jPanel1Layout.createSequentialGroup()
                                                                     .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                               .addGroup(jPanel1Layout.createSequentialGroup()
                                                                                         .addGap(6, 6, 6)
                                                                                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                                                   .addComponent(Round)
                                                                                                   .addComponent(Nr)
                                                                                                   .addComponent(Sum, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                                               .addGroup(jPanel1Layout.createSequentialGroup()
                                                                                         .addContainerGap()
                                                                                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                                                   .addComponent(Out, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                                   .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                                                             .addComponent(AllIn, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                                             .addComponent(ExchangeCards, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                                             .addComponent(Check, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                                                                     .addGap(0, 0, Short.MAX_VALUE)))
                                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                 .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                 .addContainerGap())
                                       .addGroup(jPanel1Layout.createSequentialGroup()
                                                 .addContainerGap()
                                                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                           .addComponent(AccountState, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                           .addComponent(Account))
                                                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                       );
        
        
        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
                                         jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                         .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                                                   .addContainerGap(236, Short.MAX_VALUE)
                                                   .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                             .addGroup(jPanel3Layout.createSequentialGroup()
                                                                       .addGap(6, 6, 6)
                                                                       .addComponent(OnTable))
                                                             .addComponent(TableCash))
                                                   .addGap(230, 230, 230))
                                         );
        jPanel3Layout.setVerticalGroup(
                                       jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                       .addGroup(jPanel3Layout.createSequentialGroup()
                                                 .addGap(84, 84, 84)
                                                 .addComponent(TableCash)
                                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                 .addComponent(OnTable)
                                                 .addContainerGap(112, Short.MAX_VALUE))
                                       );
        
        jPanel4.setBackground(new java.awt.Color(0, 0, 204));
        
        jTextArea1.setColumns(20);
        jTextArea1.setRows(5);
        jScrollPane2.setViewportView(jTextArea1);
        
        jTextArea2.setColumns(20);
        jTextArea2.setRows(5);
        jScrollPane3.setViewportView(jTextArea2);
        
        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
                                         jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                         .addComponent(Send, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                         .addGroup(jPanel4Layout.createSequentialGroup()
                                                   .addContainerGap()
                                                   .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                                             .addComponent(jScrollPane2)
                                                             .addComponent(jScrollPane3))
                                                   .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                         );
        jPanel4Layout.setVerticalGroup(
                                       jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                       .addGroup(jPanel4Layout.createSequentialGroup()
                                                 .addContainerGap()
                                                 .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 363, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                 .addGap(18, 18, 18)
                                                 .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                 .addComponent(Send))
                                       );
        
        
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
                                  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                  .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                  .addGroup(layout.createSequentialGroup()
                                            .addGap(46, 46, 46)
                                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                      .addGroup(layout.createSequentialGroup()
                                                                .addComponent(jButton29, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jCheckBox21, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addGap(0, 0, Short.MAX_VALUE))
                                                      .addGroup(layout.createSequentialGroup()
                                                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                                          .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                                    .addComponent(jButton26, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                    .addComponent(jButton27, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                          .addGroup(layout.createSequentialGroup()
                                                                                    .addComponent(jButton28, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                    .addGap(2, 2, 2)))
                                                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                          .addGroup(layout.createSequentialGroup()
                                                                                    .addComponent(jCheckBox22, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                    .addGap(13, 13, 13))
                                                                          .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                                                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                                                              .addComponent(jCheckBox24, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                              .addComponent(jCheckBox23, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                                                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                          .addGroup(layout.createSequentialGroup()
                                                                                    .addGap(8, 8, 8)
                                                                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                                                              .addComponent(jCheckBox20, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                              .addComponent(jButton25, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                                              .addComponent(jCheckBox19, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                              .addComponent(jButton24, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                                                              .addGroup(layout.createSequentialGroup()
                                                                                                        .addComponent(jCheckBox18, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                                        .addGap(27, 27, 27)
                                                                                                        .addComponent(jCheckBox17, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                                        .addGap(11, 11, 11))
                                                                                              .addGroup(layout.createSequentialGroup()
                                                                                                        .addComponent(jButton23, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                                                        .addComponent(jButton22, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                                              .addGroup(layout.createSequentialGroup()
                                                                                                        .addGap(98, 98, 98)
                                                                                                        .addComponent(jCheckBox16, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                                        .addGap(18, 18, 18)
                                                                                                        .addComponent(jCheckBox15, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                                        .addGap(30, 30, 30)
                                                                                                        .addComponent(jCheckBox14, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                                        .addGap(30, 30, 30)
                                                                                                        .addComponent(jCheckBox13, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                                              .addGroup(layout.createSequentialGroup()
                                                                                                        .addGap(85, 85, 85)
                                                                                                        .addComponent(jButton21, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                                                        .addComponent(jButton20, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                                                        .addComponent(jButton19, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                                                        .addComponent(jButton18, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                                                          .addGroup(layout.createSequentialGroup()
                                                                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                                              .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                              .addGroup(layout.createSequentialGroup()
                                                                                                        .addGap(6, 6, 6)
                                                                                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                                                                  .addGroup(layout.createSequentialGroup()
                                                                                                                            .addGap(6, 6, 6)
                                                                                                                            .addComponent(jCheckBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                                                            .addGap(31, 31, 31)
                                                                                                                            .addComponent(jCheckBox2, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                                                                  .addGroup(layout.createSequentialGroup()
                                                                                                                            .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                                                                            .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                                                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                                                                  .addGroup(layout.createSequentialGroup()
                                                                                                                            .addGap(12, 12, 12)
                                                                                                                            .addComponent(jCheckBox3, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                                                                  .addGroup(layout.createSequentialGroup()
                                                                                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                                                                            .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                                                                  .addComponent(jButton9, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                                                  .addGroup(layout.createSequentialGroup()
                                                                                                                            .addGap(6, 6, 6)
                                                                                                                            .addComponent(jCheckBox4, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                                                                        .addGap(59, 59, 59)
                                                                                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                                                                  .addComponent(jButton10, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                                                  .addGroup(layout.createSequentialGroup()
                                                                                                                            .addGap(6, 6, 6)
                                                                                                                            .addComponent(jCheckBox5, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                                                                  .addComponent(jButton11, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                                                  .addGroup(layout.createSequentialGroup()
                                                                                                                            .addGap(6, 6, 6)
                                                                                                                            .addComponent(jCheckBox6, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                                                                  .addComponent(jButton12, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                                                  .addGroup(layout.createSequentialGroup()
                                                                                                                            .addGap(6, 6, 6)
                                                                                                                            .addComponent(jCheckBox7, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                                                                  .addGroup(layout.createSequentialGroup()
                                                                                                                            .addGap(6, 6, 6)
                                                                                                                            .addComponent(jCheckBox8, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                                                                  .addComponent(jButton13, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                                              .addComponent(jCheckBox11, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                                                        .addComponent(jCheckBox10, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                                        .addComponent(jCheckBox9, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                                              .addComponent(jCheckBox12, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                                              .addComponent(jButton17, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                              .addComponent(jButton16, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                              .addComponent(jButton14, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                              .addComponent(jButton15, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 110, Short.MAX_VALUE)
                                                                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                            .addContainerGap())
                                  );
        layout.setVerticalGroup(
                                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(layout.createSequentialGroup()
                                          .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                                          .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(layout.createSequentialGroup()
                                                              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                              .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                              .addContainerGap())
                                                    .addGroup(layout.createSequentialGroup()
                                                              .addGap(35, 35, 35)
                                                              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                        .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addComponent(jButton9, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addComponent(jButton10, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addComponent(jButton11, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addComponent(jButton12, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addComponent(jButton13, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                              .addGap(12, 12, 12)
                                                              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                                  .addComponent(jCheckBox2, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                  .addComponent(jCheckBox3, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                  .addComponent(jCheckBox4, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                  .addComponent(jCheckBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                                  .addComponent(jCheckBox6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                                                  .addComponent(jCheckBox5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                                  .addComponent(jCheckBox7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                                                  .addComponent(jCheckBox8)))
                                                              .addGap(18, 18, 18)
                                                              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addGroup(layout.createSequentialGroup()
                                                                                  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                                            .addComponent(jCheckBox9)
                                                                                            .addComponent(jButton14, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                                  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                                            .addComponent(jButton15, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                            .addComponent(jCheckBox10, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                                  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                                            .addComponent(jButton16, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                            .addComponent(jCheckBox11))
                                                                                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                                  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                                            .addComponent(jButton17, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                            .addComponent(jCheckBox12, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                                        .addGroup(layout.createSequentialGroup()
                                                                                  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                                            .addComponent(jButton26, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                            .addComponent(jCheckBox24))
                                                                                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                                  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                                                            .addComponent(jButton27, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                            .addComponent(jCheckBox23, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                                  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                                            .addComponent(jButton28, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                            .addComponent(jCheckBox22))
                                                                                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                                  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                                            .addComponent(jCheckBox21)
                                                                                            .addComponent(jButton29, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                                                              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                                  .addComponent(jCheckBox13, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                  .addComponent(jCheckBox14)
                                                                                  .addComponent(jCheckBox15)
                                                                                  .addComponent(jCheckBox16))
                                                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                                  .addComponent(jCheckBox17, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                  .addComponent(jCheckBox18)
                                                                                  .addComponent(jCheckBox19)
                                                                                  .addComponent(jCheckBox20)))
                                                              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                                  .addComponent(jButton22, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                  .addComponent(jButton24, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                  .addComponent(jButton25, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                  .addComponent(jButton23, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                                                  .addComponent(jButton18, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                  .addComponent(jButton19, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                  .addComponent(jButton20, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                  .addComponent(jButton21, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                              .addGap(0, 65, Short.MAX_VALUE)))));
        
        Send.setText("Send");
        
        ExchangeCards.setText("Exchange Cards");
        AllIn.setText("All In");
        
        Out.setText("Out");
        Accept.setText("Accept");
        
        Communicate.setText("communicate");
        
        
        
        this.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent we) { 
                String ObjButtons[] = {"Yes","No"};
                int PromptResult = JOptionPane.showOptionDialog(null, 
                "Are you sure you want to exit?", "Online Examination System", 
                JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null, 
                ObjButtons,ObjButtons[1]);
                if(PromptResult==0)
                {
                System.exit(0);          
                }
            }
        });

        
        
        AllIn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AllInActionPerformed(evt);
            }
        });
        
        ExchangeCards.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                try {
                    ExchangeCardsActionPerformed(evt);
                } catch (IOException ex) {
                    Logger.getLogger(GUIoff.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        });
        
        Out.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
            }
        });
        
        Accept.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
            }
        });
        
        Check.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
            }
        });
        
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox1.isSelected(); 
            }
        });
        
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox2.isSelected(); 
            }
        });
        
        jButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox3.isSelected(); 
            }
        });
        
        jButton9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox4.isSelected(); 
            }
        });
        
        jButton10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox5.isSelected(); 
            }
        });
        
        jButton11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox6.isSelected(); 
            }
        });
        
        jButton12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox7.isSelected(); 
            }
        });
        
        jButton13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox8.isSelected(); 
            }
        });
        
        jButton14.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox9.isSelected(); 
            }
        });
        
        jButton15.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox10.isSelected(); 
            }
        });
        
        jButton16.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox11.isSelected(); 
            }
        });
        
        jButton17.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox12.isSelected(); 
            }
        });
        
        jButton18.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox13.isSelected(); 
            }
        });
        
        jButton19.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox14.isSelected(); 
            }
        });
        
        jButton20.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox15.isSelected(); 
            }
        });
        
        jButton21.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox16.isSelected(); 
            }
        });
        
        jButton22.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox17.isSelected(); 
            }
        });
        
        jButton23.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox18.isSelected(); 
            }
        });
        
        jButton24.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox19.isSelected(); 
            }
        });
        
        jButton25.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox20.isSelected(); 
            }
        });
        jButton26.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox21.isSelected(); 
            }
        });
        
        jButton27.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox22.isSelected(); 
            }
        });
        
        jButton28.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox22.isSelected(); 
            }
        });
        
        jButton29.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckBox23.isSelected(); 
            }
        });              
        

        if(NumberOfPlayers>=2)
        {
            jButton6.setVisible(true);
            jButton6.setEnabled(true);
            jCheckBox1.setEnabled(true);
            jButton7.setVisible(true);
            jButton7.setEnabled(true);
            jCheckBox2.setEnabled(true);
            jButton8.setVisible(true);
            jButton8.setEnabled(true);
            jCheckBox3.setEnabled(true);
            jButton9.setVisible(true);
            jButton9.setEnabled(true);
            jCheckBox4.setEnabled(true);
            jButton10.setVisible(true);
            jButton10.setEnabled(true);
            jCheckBox5.setEnabled(true);
            jButton11.setVisible(true);
            jButton11.setEnabled(true);
            jCheckBox6.setEnabled(true);
            jButton12.setVisible(true);
            jButton12.setEnabled(true);
            jCheckBox7.setEnabled(true);
            jButton13.setVisible(true);
            jButton13.setEnabled(true);
            jCheckBox8.setEnabled(true);
            
            if(NumberOfPlayers>=3){
                jButton14.setVisible(true);
                jButton14.setEnabled(true);
                jCheckBox9.setEnabled(true);
                jButton15.setVisible(true);
                jButton15.setEnabled(true);
                jCheckBox10.setEnabled(true);
                jButton16.setVisible(true);
                jButton16.setEnabled(true);
                jCheckBox11.setEnabled(true);
                jButton17.setVisible(true);
                jButton17.setEnabled(true);
                jCheckBox12.setEnabled(true);
                
                if(NumberOfPlayers>=4){
                    jButton18.setVisible(true);
                    jButton18.setEnabled(true);
                    jCheckBox13.setEnabled(true);
                    jButton19.setVisible(true);
                    jButton19.setEnabled(true);
                    jCheckBox14.setEnabled(true);
                    jButton20.setVisible(true);
                    jButton20.setEnabled(true);
                    jCheckBox15.setEnabled(true);
                    jButton21.setVisible(true);
                    jButton21.setEnabled(true);
                    jCheckBox16.setEnabled(true);
                    
                    if(NumberOfPlayers>=5){
                        jButton22.setVisible(true);
                        jButton22.setEnabled(true);
                        jCheckBox17.setEnabled(true);
                        jButton23.setVisible(true);
                        jButton23.setEnabled(true);
                        jCheckBox18.setEnabled(true);
                        jButton24.setVisible(true);
                        jButton24.setEnabled(true);
                        jCheckBox19.setEnabled(true);
                        jButton25.setVisible(true);
                        jButton25.setEnabled(true);
                        jCheckBox20.setEnabled(true);
                        
                        if(NumberOfPlayers==6){
                            jButton26.setVisible(true);
                            jButton26.setEnabled(true);
                            jCheckBox21.setEnabled(true);
                            jButton27.setVisible(true);
                            jButton27.setEnabled(true);
                            jCheckBox22.setEnabled(true);
                            jButton28.setVisible(true);
                            jButton28.setEnabled(true);
                            jCheckBox23.setEnabled(true);
                            jButton29.setVisible(true);
                            jButton29.setEnabled(true);
                            jCheckBox24.setEnabled(true);
                        }
                    }
                }
                
            }
        }
        
        jScrollPane1.setBackground(new java.awt.Color(255, 0, 51));
        jScrollPane1.setForeground(new java.awt.Color(204, 0, 0));
        
        jTextArea1.setColumns(20);
        jTextArea1.setRows(5);
        jScrollPane2.setViewportView(jTextArea1);
        
        jTextArea2.setEditable(false);
        
        
        Check.setText("Check");
        
        Send.setText("Send");
        
        AccountState.setText("Account State");
        Account.setText("0000");
        
        Round.setText("Round");
        Nr.setText("0");
        
        Sum.setText("0");
        
        TableCash.setText("TableCash");
        OnTable.setText("0000");
        
        pack();
        
    }
    
    private void AllInActionPerformed(java.awt.event.ActionEvent evt) {                                         
        bank=Integer.parseInt(TableCash.getText());
        money=Integer.parseInt(Account.getText());
        bank=bank+money;
        money=0;
        AllIn.setEnabled(false);
        Accept.setEnabled(false);
        Sum.setEditable(false); 
    }  
    
    private void OutActionPerformed(java.awt.event.ActionEvent evt) {                                                 
        AllIn.setEnabled(false);
        Accept.setEnabled(false);
        Sum.setEditable(false);         
    }  
    
    private void AcceptActionPerformed(java.awt.event.ActionEvent evt) {                                                 
        Communicate.setText("");
        bank=Integer.parseInt(TableCash.getText());
        money=Integer.parseInt(Account.getText());
        adventurer=Integer.parseInt(Sum.getText());
        if(money>Table.smallBlind){
            if(adventurer<money)
            {
                bank=bank+adventurer;
                money=money-adventurer;
                if(money>bet)
                {
                    bet=money;
                    check=0;
                }   
            }
            else
            {
                Communicate.setText("Too little money. Choose All-in or Out");
            }
        }
        else
            {
                Communicate.setText("Too little money. Choose All-in or Out");
            }
    } 
    
    private void ExchangeCardsActionPerformed(java.awt.event.ActionEvent evt) throws IOException {
        itemStateChanged();
    }
    
    private void CheckActionPerformed(java.awt.event.ActionEvent evt) {                                         
        AllIn.setEnabled(false);
        Accept.setEnabled(false);
        Sum.setEditable(false); 
        check=check+1;
    }  
    
    public static void main(String[] args)
    {
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                final GUIoff frame = new GUIoff();
                
                
                frame.setVisible(true);
                
            }
        });
        
        
    }
    
    public void itemStateChanged() throws IOException
    {
        ChangeCard.ifCheckbox();    
    }
    
    
    public boolean GameIsOn()
     {
     if(Round.getText().equals("3"))
     return false;
     }
    
    public void NextRound()
    {
        if(NumberOfPlayers==check)
        roundCounter=roundCounter+1;
    }

}

